#include "udpClient.hpp"
#include <memory>

using namespace Client;

static void Usage()
{
    cout << "Usage: 可执行程序 server_ip server_port" << endl;
}

//  ./Client server_ip server_port
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage();
        exit(USAGE_ERR);
    }

    uint16_t serverPort = atoi(argv[2]);
    string serverIp = argv[1];

    unique_ptr<udpClient> clt(new udpClient(serverPort, serverIp));

    clt->initClient();
    clt->run();

    return 0;
}
